package community.hospital.service.application;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import community.hospital.common.BaseRemove;
import community.hospital.common.R;
import community.hospital.entity.User;
import community.hospital.entity.request.*;
import community.hospital.entity.response.LoginResultModel;
import community.hospital.entity.response.UserInfoModel;
import community.hospital.entity.response.UserResponse;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author：ydj
 * @Date：2023/1/16 16:58
 */
public interface UserApplicationService {
    /**
     * 用户注册
     * @param request
     * @return
     */
    boolean addUser(AddUserRequest request);

    /**
     * 用户登录
     * @param request
     * @return
     */
    R<LoginResultModel> login(LoginRequest request);

    /**
     * 退出登录
     * @param request
     * @return
     */
    Boolean logout(HttpServletRequest request);

    /**
     * 分页待条件查询用户
     * @param request
     * @return
     */
    Page<UserResponse> listUser(ListUserRequest request);

    /**
     * 删除用户
     * @param request
     * @return
     */
    Boolean removeUser(BaseRemove request);

    /**
     * 更新用户信息
     * @param request
     * @return
     */
    Boolean updateUser(UpdateUserRequest request);

    /**
     * 修改用户密码
     * @param request
     * @return
     */
    Boolean updatePassword(UpdatePasswordRequest request);

    UserResponse queryByUserId(Long userId);

    UserInfoModel getUserInfoModel();

    UserResponse getUserInfo(Long userId);

    Boolean isAccountExit(User request);

    Boolean updateCurrentUserPassword(PasswordRequest request);

}
